/**
 * 导航辅助工具
 * 用于管理路由导航状态、权限检查和导航历史
 */

// 存储已验证权限的路径
let verifiedRoutes = {
  // 预设这些路径为已验证，确保首次访问正常
  '/main': true,
  '/main/screening': true,
  '/main/export': true,
  '/main/quota': true,
  '/main/recharge': true,
  '/main/support': true
};

/**
 * 标记路由为已验证
 * @param {string} path - 路由路径
 */
export const markRouteVerified = (path) => {
  verifiedRoutes[path] = true;
};

/**
 * 检查路由是否已验证
 * @param {string} path - 路由路径
 * @returns {boolean} - 路由是否已验证
 */
export const isRouteVerified = (path) => {
  return !!verifiedRoutes[path];
};

/**
 * 重置特定路由验证状态
 * @param {string} path - 路由路径
 */
export const resetRouteVerification = (path) => {
  if (verifiedRoutes[path]) {
    delete verifiedRoutes[path];
  }
};

/**
 * 重置所有路由验证状态
 */
export const resetAllVerifications = () => {
  verifiedRoutes = {};
};

export default {
  markRouteVerified,
  isRouteVerified,
  resetRouteVerification,
  resetAllVerifications
}; 